package org.gcb.core.model;

import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;

/**
 *
 * @author Jason
 */
public class DefenseSet extends HashMap<EDefense, Defense>{
    
    private final Set<EDefense> keys;

    public DefenseSet(Toon toon) {
        Set<EDefense> temp = new HashSet<EDefense>(EDefense.values().length);
        temp.addAll(Arrays.asList(EDefense.values()));
        for (EDefense def : temp) {
            if (def==EDefense.AC) {
                //TODO define a toon's AC ability type (probably from RACE or CLASS)  for now... STR
                put(def, new Defense(toon, def, AbilityType.STR));
            } else {
                put(def, new Defense(toon, def));
            }
        }
        keys = Collections.<EDefense>unmodifiableSet(temp);
    }
    
}
